package cn.lg.soar.system.biz.modules.tenant.entity;

import cn.lg.soar.common.util.trans.annotations.TranslateName;
import cn.lg.soar.core.annotations.constraints.group.Create;
import cn.lg.soar.core.annotations.constraints.group.Update;
import cn.lg.soar.database.base.entity.BaseEntity;
import cn.lg.soar.database.translate.TranslateByEntity;
import cn.lg.soar.system.biz.modules.auth.entity.Component;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * 租户套餐菜单
 * @author luguoxiang
 * @since 2025-05-05
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
@Schema(description = "租户套餐菜单")
@TableName("lg_sys_tenant_combo_meal_menu")
public class TenantComboMealMenu extends BaseEntity {

    /**  */
    @NotNull(message = "主键不能为空", groups = { Update.class })
    @ExcelIgnore
    @Schema(description = "主键")
    @TableId
    private Integer id;

    /** 套餐id */
    @NotNull(message = "套餐id不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "套餐id")
    @Schema(description = "套餐id")
    private Integer comboMealId;

    /** 父id(0表示最顶级) */
    @NotNull(message = "父id(0表示最顶级)不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "父id(0表示最顶级)")
    @Schema(description = "父id(0表示最顶级)")
    private Integer parentId;

    /** 类型(0按钮，1菜单，2目录，3系统) */
    @NotNull(message = "类型(0按钮，1菜单，2目录，3系统)不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "类型(0按钮，1菜单，2目录，3系统)")
    @Schema(description = "类型(0按钮，1菜单，2目录，3系统)")
    private Integer type;

    /** 名称(标题) */
    @NotBlank(message = "名称(标题)不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "名称(标题)")
    @Schema(description = "名称(标题)")
    private String title;

    /** 路径 */
    @ExcelProperty(value = "路径")
    @Schema(description = "路径")
    private String path;

    /** 重定向路径 */
    @ExcelProperty(value = "重定向路径")
    @Schema(description = "重定向路径")
    private String redirect;

    /** 组件id */
    @TranslateName("componentName")
    @TranslateByEntity(Component.class)
    @ExcelProperty(value = "组件id")
    @Schema(description = "组件id")
    private Integer componentId;

    /** 图标 */
    @ExcelProperty(value = "图标")
    @Schema(description = "图标")
    private String icon;

    /** 是否隐藏子菜单（0否，1是） */
    @NotNull(message = "是否隐藏子菜单（0否，1是）不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "是否隐藏子菜单（0否，1是）")
    @Schema(description = "是否隐藏子菜单（0否，1是）")
    private Integer hideChildren;

    /** 排序 */
    @NotNull(message = "排序不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "排序")
    @Schema(description = "排序")
    private Integer sort;

    /** 状态：0正常，1隐藏菜单，2禁用菜单 */
    @NotNull(message = "状态：0正常，1隐藏菜单，2禁用菜单不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "状态：0正常，1隐藏菜单，2禁用菜单")
    @Schema(description = "状态：0正常，1隐藏菜单，2禁用菜单")
    private Integer status;

    @JsonIgnore
    @Override
    public Integer primaryKey() {
        return this.id;
    }

}
